The effectiveness of the front cache is limited by
subpixel positioning making it very likely that we
will meet the same glyph in different x phases inside
a single line of text.
Factoring the xphase into the front cache key makes things
better. For the string
eeeeeeeeeeeeeeeeeee
before: 0% front cache hits
after: >90% front cache hits
const GskNglGlyphValue **out_value)
{
GskNglTextureAtlasEntry *entry;
- guint front_index = key->glyph & 0xFF;
+ guint front_index = ((key->glyph << 2) | key->xshift) & 0xFF;
if (memcmp (key, &self->front[front_index], sizeof *key) == 0)
{